package com.py.chat.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.py.chat.service.ChatLogService;

public class Gloable {
	// 用户内存集合
	public static Map<String, User> userMap = new HashMap<>();
	// 用户在线集合
	public static Map<String, User> sessionMap = new HashMap<>();
	// 内存聊天记录集合
	public static List<ChatLog> chatLogList = new ArrayList<>();
	// 初始化内存聊天记录
	public static void init(){
		chatLogList = ChatLogService.getAllList();
		for(ChatLog chatLog:chatLogList){
			userMap.put(chatLog.getUser().getId(), chatLog.getUser());
		}
	}
}

